package pers.mobian.springfifth;

import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Date 2021/7/14 20:13
 * @Created mobian
 * @Description
 */
public class BianChengShiSpringTest {
	public static void main(String[] args) {

		AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
		applicationContext.register(BianChengShiSpringTest.class);

		AbstractBeanDefinition definition = BeanDefinitionBuilder.genericBeanDefinition().getBeanDefinition();
		definition.setBeanClass(Teacher.class);

		applicationContext.registerBeanDefinition("teacher",definition);
		applicationContext.refresh();


		Teacher bean = (Teacher) applicationContext.getBean("teacher");

		System.out.println(bean);

	}
}
